/**
 * @Author：ming
 * @Date：2023/10/29 12:20 AM
 * @Filename：Hot11
 */

/**
 * @author ming
 */
public class Hot11 {
    public int maxArea(int[] height) {
        int l =0;
        int r = height.length-1;
        int max = 0;
        while (l<r){
           int  area = Math.min(height[l],height[r])*(r-l);
            max = Math.max(max,area);
            if(height[l]<height[r]){
                l++;
            }else {
                r--;
            }
        }

        return max;
    }
}
